package com.example.demo.mapper;

import com.example.demo.model.entity.UserPrize;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserPrizeMapper {

    @Insert("insert into user_prize (user_id, prize_type, prize_id, valid, activity_name, prize_name)" +
            "values (#{userId}, #{prizeType}, #{prizeId}, #{valid}, #{activityName}, #{prizeName})")
    void insert(UserPrize userPrize);

    @Select("select * from user_prize where user_id = #{userId}")
    List<UserPrize> selectByUserId(int userId);
}
